package com.hj.springmybatis.controller;

import com.hj.springmybatis.mappers.UserMapper;
import com.hj.springmybatis.pojo.User;
import com.hj.springmybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("user")
@RestController
public class UserController {
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private UserService userService;
    @GetMapping("find")
    public List<User> findAll() {
        return userMapper.findAll();
    }
    @GetMapping("delete")
    public int deleteById() {
        return userService.deleteUserById();
    }
}
